home *** CD-ROM | disk | FTP | other *** search
- !
- ! Default quester script..
- !
- ! (c) DC Software, 1992
- !
-
- !------------------------------------------------------------------------!
- :@TALK ! Talk to the character !
- !------------------------------------------------------------------------!
-
- ! No more quests?
- if npc.v1 = 16 GOTO NOMORE;
-
- ! Always talk to the leader of the pack..
- group.current = 0;
-
- ! Initialize the first time through..
- if npc.v0 = 0 then
- npc.v0 = 1; ! We've talked, but no quest is pending..
- npc.v1 = 0; ! Do quest 0 first.
- else
- if npc.v0 = 2 goto QUEST; ! We already have a quest..
- endif;
-
- ! Select the item to be quested..
- :LOOP
- setbp( npc, npc.v1 );
- if npc.bp.count = 0 then
- inc( npc.v1 ); ! The slot is empty, check the next one !
- if npc.v1 = 16
- goto NOMORE; ! We've got no more quests !
- goto LOOP;
- endif;
-
- :START
- writeln( "Are you in need of a quest?" );
-
- L1 = select( "Yes", "No", "Talk", "Bye" );
- ON L1 GOTO QYES, QNO, CHAT, CSTOP;
-
- :QYES
- writeln( "I'll pay you ", $npc.bp.value, " if you bring me the ", npc.bp.name );
- writeln( "Good luck.." );
- npc.v0 = 2; ! Quest Given
- STOP;
-
- :QNO
- writeln( "Then be on your way please.." );
- STOP;
-
- !
- ! We HAVE a quest
- !
- :QUEST
- setbp( npc, npc.v1 ); ! Select the quest that was given.. !
- writeln( player.name, "! Have you brought me the ", npc.bp.name, "?" );
- voice( "Quest" );
-
- L1 = select( "Yes", "No", "Talk", "Bye" );
- on L1 goto CYES, CNO, CHAT;
- goto CSTOP;
-
- :CYES
-
- ! Find out WHO has the item
- L2 = find( player, npc.bp.name );
- if L2 < 0 then
- ! No one, so find out if the object is a person..
- L2 = find( group, npc.bp.name );
- if L2 < 0 goto NOTHERE;
- endif;
-
- group.current = L2;
- ! If the player's name matches the backpack name, its a RESCUE !
- if player.name = npc.bp.name then
- writeln( player.name, "! I almost didn't recognize you.." );
- !
- ! When the rescued person leaves the party, take the following actions
- !
- player.v1 = 2; ! 1 when I join the party. 2 on delivery!
- if( player.text >= 0 ) then
- inc( player.text ); ! Change text block (if any)
- endif;
- if( player.voice >= 0 ) then
- inc( player.voice ); ! Change voice file (if any)
- endif;
- if( player.picture >= 0 ) then
- inc( player.picture ); ! Change picture file (if any)
- endif;
- player.type = CIVILIAN; ! No longer a prisoner !
- ! Place the player at next to the NPC (quester)
- leave( player.index, npc.x+1, npc.y ); ! Remove from the party
- group.current = 0;
- else
- ! Otherwise, the quested item is in the player's backpack.
- L2 = find( player.bp, npc.bp.name, npc.bp.type );
- if L2 < 0 GOTO NOTHERE;
- vanish( player.bp );
- endif;
-
- npc.v0 = 1; ! No quest pending, but we already met
- inc(npc.v1); ! Increment backpack index for next quest (if any)
-
- ! Now give a reward..
- inc( group.gold, npc.bp.value ); ! Pay for it !
- writeln( $npc.bp.value, " is the reward. Here it is." );
-
- if npc.bp.weight > 0 then
- L4 = npc.bp.weight; ! Experience is given here !
- else
- L4 = npc.bp.value / 10 * (random(3)+1) + 1; ! Give random experience !
- endif;
-
- ! Do the whole party..
- foreach player do
- inc( player.exp, L4 ); ! Level promotions are automatic !
- endfor;
-
- if npc.bp.endgame = END_ON_GIVE then
- if npc.bp.endtext > 0 then
- readtext( npc.bp.endtext );
- endif;
- ENDGAME;
- endif;
-
- :CSTOP
- writeln( "May the force be with you." );
- STOP;
-
- :CNO
- writeln( "Why are you back then?" );
- GOTO CHAT1;
-
- !
- ! Conversation is optional for a quester, but this one likes to chat..
- !
- :CHAT
- writeln( "What would you like to talk about?" );
-
- :CHAT1
- L3 = getstr("Name","Where","Quest","Bye");
-
- ! First, see if the keyword typed is in the character's text block !
- if dotext( S0 ) then
- if L3 = 3 then
- STOP;
- endif;
- goto CHAT1;
- endif;
-
- ! It didn't, so try the predefined ones..
- on L3 goto CName, WHERE, START, CSTOP;
-
- ! Nope, try a 'DEFAULT' line
- if not dotext( "DEFAULT" ) then
- writeln( "I don't know anything about that!" );
- endif;
- goto CHAT1;
-
- :CName
- writeln( "My name is ", npc.name, "." );
- GOTO CHAT1;
-
- :WHERE
- writeln( "If I knew where, I wouldn't need your services!" );
- GOTO CHAT1;
-
- :NOMORE
- writeln( "Sorry, I have no more quests." );
- STOP;
-
- :NOTHERE
- writeln( "You don't have the ", npc.bp.name, " with you." );
- writeln( "Are you sure you found it?" );
- L3 = select( "Yes", "No", "Maybe", "What", "Who", "Ugh..", "Bye" );
- writeln( "Hmm.. Come back when you find it.." );
- STOP;
-